﻿using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Activation;
using mal.balades.Business.DataModel;
using mal.balades.Business.Web;

namespace mal.balades.Web.Administration
{
    [ServiceContract(Namespace = "mal.balades.Web.Administration")]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class VisitService
    {
        [OperationContract]
        public IEnumerable<mal.balades.Business.DataModel.VisitQuality> GetAllVisits()
        {
            return BaladesManagerProxy.Instance.VisitQualityDataAccess.GetVisitQualities().OrderBy(v => v.Title);

        }

        [OperationContract]
        public mal.balades.Business.DataModel.Visit GetVisit(int visitId)
        {
            return BaladesManagerProxy.Instance.VisitDataAccess.GetVisit(visitId);
        }

        [OperationContract]
        public int SaveVisit(mal.balades.Web.Administration.VisitQuality visitQuality, mal.balades.Web.Administration.Visit visit)
        {


            //BaladesManagerProxy.Instance.VisitDataAccess.Update(visit);
            //visitQuality.VisitID = visit.VisitID;

            //BaladesManagerProxy.Instance.VisitQualityDataAccess.Update(visitQuality);

            return visit.VisitID;
        }
    }
}
